<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script>
			var js = {
				'name':'bgg',
				'age':18
			}
			//json对象转字符串
			var str = JSON.stringify(js);
			console.log(typeof str);
			
			
			//字符串转json对象
			var obj = JSON.parse(str);
			console.log(typeof obj);
		</script>
	</body>
</html>
